package com.demo.function.shardingsphere;

import com.demo.dao.mapper.UserMapper;
import com.demo.model.entity.db.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 复合分片策略, 根据多个字段计算查询哪些DB
 * @author cyj
 */
@Service
public class ComplexStrategyService {

    @Resource
    private UserMapper userMapper;

    public List<User> queryByUserNameIdGt(String userName, Long userId) {
        return userMapper.queryByUserNameIdGt(userName, userId);
    }
}
